import java.util.Arrays;

public class J2101 {
    public static void Bud(int[] arr){
        int i, j;
        int k = arr.length;
        for(i = 0; i < k ; i++){
            boolean flage = false;
            for(j = 0; j < k - i -1; j++){
                int tmp = 0;
                if(arr[j] > arr[j + 1]){
                    tmp = arr[j];
                    arr[j] = arr[j + 1];
                    arr[j + 1] = tmp;
                    flage = true;
                }
            }
            if(!flage){
                break;
            }
        }
    }

    public static void main(String[] args) {
        int[] arr = new int[] {2,5,6,4,7,9,3,1,10,8};
        Bud(arr);
        String ret = Arrays.toString(arr);
        System.out.println(ret);
    }
}
